<?php
class Login_Model_Auth extends Zend_Db_Table_Abstract
{
    public function authenticate($request)
    {
        try {
            $this->_db->getConnection();

            $query = $this->_db->select()
                    ->from('login_users',
                           array('users_role', 'users_name'))
                    ->where('users_name' . ' = ?', $request['name'])
                    ->where('users_password' . ' = ?', md5($request['password']));
            // Return role ID
            return $this->_db->fetchRow($query);

        } catch (Exception $e) {

            return FALSE;
        }
    }
}